package main

import "fmt"

// 返回一个“返回int的函数”
func fibonacci() func(int) int {


	a := 0
	b := 1

		return func(i int) int{
			temp := a
			a, b = b, a+b

			return temp
		}

}

func main() {
	f := fibonacci()
	for i := 0; i < 10; i++ {
		fmt.Println(f(i))
	}
}
